<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sijyp="http://java.sun.com/jsf/composite/sijyp">

	<a4j:outputPanel id="pnl_lista_cadaver">
		<a4j:region id="rg_lista_cadaver">
			<rich:dataTable id="dt_cadaveres" keepSaved="true" rowKeyVar="index"
				var="record" noDataLabel="${msg['general.registrosNoEncontrados']}"
				value="#{managedBean.cadaveres.cadaveresDm.dataModel}" rows="10">
				<ui:include src="/resources/sijyp/dataModels/column.xhtml">
					<ui:param name="render_sort" value="dt_cadaveres" />
					<ui:param name="key" value="nombre_cadaver" />
					<ui:param name="header"
						value="#{msgExh['exhumaciones.diligencia.cadaver.nombre_cadaver']}" />
					<ui:param name="column" value="1" />
					<ui:param name="managedBean"
						value="#{managedBean.cadaveres.cadaveresDm}" />
				</ui:include>
				<ui:include src="/resources/sijyp/dataModels/column.xhtml">
					<ui:param name="render_sort" value="dt_cadaveres" />
					<ui:param name="key" value="tipo_doc" />
					<ui:param name="header"
						value="#{msgExh['exhumaciones.catalogo.tipo_documento']}" />
					<ui:param name="column" value="2" />
					<ui:param name="managedBean"
						value="#{managedBean.cadaveres.cadaveresDm}" />
				</ui:include>
				<ui:include src="/resources/sijyp/dataModels/column.xhtml">
					<ui:param name="render_sort" value="dt_cadaveres" />
					<ui:param name="key" value="numero_doc" />
					<ui:param name="header"
						value="#{msgExh['exhumaciones.diligencia.num_documento']}" />
					<ui:param name="column" value="3" />
					<ui:param name="managedBean"
						value="#{managedBean.cadaveres.cadaveresDm}" />
				</ui:include>
				<ui:include src="/resources/sijyp/dataModels/column.xhtml">
					<ui:param name="render_sort" value="dt_cadaveres" />
					<ui:param name="key" value="nombre_familiar" />
					<ui:param name="header"
						value="#{msgExh['exhumaciones.entregas.nombre_familiar_recibe']}" />
					<ui:param name="column" value="4" />
					<ui:param name="managedBean"
						value="#{managedBean.cadaveres.cadaveresDm}" />
				</ui:include>
				<ui:include src="/resources/sijyp/dataModels/column.xhtml">
					<ui:param name="render_sort" value="dt_cadaveres" />
					<ui:param name="key" value="pais" />
					<ui:param name="header"
						value="#{msgExh['exhumaciones.catalogo.pais']}" />
					<ui:param name="column" value="5" />
					<ui:param name="managedBean"
						value="#{managedBean.cadaveres.cadaveresDm}" />
				</ui:include>
				<ui:include src="/resources/sijyp/dataModels/column.xhtml">
					<ui:param name="render_sort" value="dt_cadaveres" />
					<ui:param name="key" value="departamento" />
					<ui:param name="header"
						value="#{msgExh['exhumaciones.catalogo.departamento']}" />
					<ui:param name="column" value="6" />
					<ui:param name="managedBean"
						value="#{managedBean.cadaveres.cadaveresDm}" />
				</ui:include>
				<ui:include src="/resources/sijyp/dataModels/column.xhtml">
					<ui:param name="render_sort" value="dt_cadaveres" />
					<ui:param name="key" value="municipio" />
					<ui:param name="header"
						value="#{msgExh['exhumaciones.catalogo.municipio']}" />
					<ui:param name="column" value="7" />
					<ui:param name="managedBean"
						value="#{managedBean.cadaveres.cadaveresDm}" />
				</ui:include>
				<ui:include src="/resources/sijyp/dataModels/column.xhtml">
					<ui:param name="render_sort" value="dt_cadaveres" />
					<ui:param name="key" value="sitio" />
					<ui:param name="header" value="#{msgExh['exhumaciones.sitio']}" />
					<ui:param name="column" value="8" />
					<ui:param name="managedBean"
						value="#{managedBean.cadaveres.cadaveresDm}" />
				</ui:include>
				<rich:column>
					<f:facet name="header">
						<h:outputLabel
							value="${msg['bienes.origen.deOficio.tabla.acciones']}" />
					</f:facet>
					<h:panelGrid columns="3"
						columnClasses="icon_space,icon_space,icon_space,icon_space,icon_space">

						<h:commandLink action="#{managedBean.cadaveres.editar(record[0])}"
							disabled="#{parentMb.estado == 'VER'}">
							<h:graphicImage value="/resources/images/icons/ico_pencil.png"
								title="${msg['boton.editar']}"
								rendered="#{parentMb.estado != 'VER'}" />
							<h:graphicImage
								value="/resources/images/icons/ico_pencil_gray.png"
								title="${msg['boton.editar']}"
								rendered="#{parentMb.estado == 'VER'}" />
							<f:ajax render="frm_entrega:pnl_cadaveres_entregados"
								disabled="#{parentMb.estado == 'VER'}" />
						</h:commandLink>

						<h:commandLink action="#{managedBean.cadaveres.ver(record[0])}">
							<h:graphicImage value="/resources/images/icons/ico_details.png"
								title="${msg['boton.consultar']}"
								rendered="#{parentMb.estado != 'VER'}" />
							<h:graphicImage
								value="/resources/images/icons/ico_details_gray.png"
								title="${msg['boton.consultar']}"
								rendered="#{parentMb.estado == 'VER'}" />
							<f:ajax render="frm_entrega:pnl_cadaveres_entregados" />
						</h:commandLink>

						<h:commandLink 
							value=""
							action="#{managedBean.cadaveres.setCadaverId(record[0])}"
							disabled="#{parentMb.estado == 'VER' or managedBean.cadaveres.disbaleEliminarCadaverEntregado}"
							onclick="#{rich:component('cadaver_confirmar_eliminar')}.show()">
							
							<h:graphicImage 
								value="/resources/images/icons/ico_delete.png"
								title="#{msg['boton.eliminar']}"
								rendered="#{parentMb.estado != 'VER' and !managedBean.cadaveres.disbaleEliminarCadaverEntregado}" />
							
							<h:graphicImage
								value="/resources/images/icons/ico_delete_disabled.png"
								title="${msg['boton.aceptar']}"
								rendered="#{parentMb.estado == 'VER' or managedBean.cadaveres.disbaleEliminarCadaverEntregado}" />
							
							<f:ajax disabled="#{parentMb.estado == 'VER'}" />
						</h:commandLink>
					</h:panelGrid>
				</rich:column>
				<f:facet name="footer">
					<rich:dataScroller   maxPages="10"
								fastStep="5"
								fastControls="hide" stepControls="show">
							</rich:dataScroller>
				</f:facet>
			</rich:dataTable>
		</a4j:region>

		<a4j:region>
			<sijyp:confirmDialog message="#{msg['general.confirmaBorrar']}"
				confirmId="cadaver_confirmar_eliminar"
				renderComponents="frm_entrega:pnl_cadaver frm_entrega:pnl_lista_cadaver"
				acceptAction="#{registrarEntregas.cadaveres.eliminar}" />
		</a4j:region>
	</a4j:outputPanel>

</ui:composition>